home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2008 February / PCWFEB08.iso / Software / Freeware / Miro 1.0 / Miro_Installer.exe / xulrunner / python / psyco / __init__.py next >
Encoding:
Python Source  |  2007-04-13  |  1.9 KB  |  55 lines

  1. ###########################################################################
  2. #  Psyco top-level file of the Psyco package.
  3. #   Copyright (C) 2001-2002  Armin Rigo et.al.
  4.  
  5. """Psyco -- the Python Specializing Compiler.
  6.  
  7. Typical usage: add the following lines to your application's main module,
  8. preferably after the other imports:
  9.  
  10. try:
  11.     import psyco
  12.     psyco.full()
  13. except ImportError:
  14.     print 'Psyco not installed, the program will just run slower'
  15. """
  16. ###########################################################################
  17.  
  18.  
  19. #
  20. # This module is present to make 'psyco' a package and to
  21. # publish the main functions and variables.
  22. #
  23. # More documentation can be found in core.py.
  24. #
  25.  
  26.  
  27. # Try to import the dynamic-loading _psyco and report errors
  28. try:
  29.     import _psyco
  30. except ImportError, e:
  31.     extramsg = ''
  32.     import sys, imp
  33.     try:
  34.         file, filename, (suffix, mode, type) = imp.find_module('_psyco', __path__)
  35.     except ImportError:
  36.         ext = [suffix for suffix, mode, type in imp.get_suffixes()
  37.                if type == imp.C_EXTENSION]
  38.         if ext:
  39.             extramsg = (" (cannot locate the compiled extension '_psyco%s' "
  40.                         "in the package path '%s')" % (ext[0], '; '.join(__path__)))
  41.     else:
  42.         extramsg = (" (check that the compiled extension '%s' is for "
  43.                     "the correct Python version; this is Python %s)" %
  44.                     (filename, sys.version.split()[0]))
  45.     raise ImportError, str(e) + extramsg
  46.  
  47. # Publish important data by importing them in the package
  48. from support import __version__, error, warning, _getrealframe, _getemulframe
  49. from support import version_info, __version__ as hexversion
  50. from core import full, profile, background, runonly, stop, cannotcompile
  51. from core import log, bind, unbind, proxy, unproxy, dumpcodebuf
  52. from _psyco import setfilter
  53. from _psyco import compact, compacttype
  54.